<!doctype html>
<%@page import="com.servicesDirectory.action.programme.ProgrammeAction"%>
<html lang="en" class="no-js">
<!--<![endif]-->
<head>
<%@taglib uri="/struts-tags" prefix="s"%>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<title>Edit Programme</title>
<meta name="description" content="">
<meta name="author" content="">

<!-- Combined stylesheets load -->
<!-- Load either 960.gs.fluid or 960.gs to toggle between fixed and fluid layout -->
<link href="css/main.css" rel="stylesheet" type="text/css">

<!-- Favicon -->
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/png" href="favicon-large.png">

<!-- Modernizr for support detection, all javascript libs are moved right above </body> for better performance -->
<script src="js/libs/modernizr.custom.min.js"
	tppabs="http://www.display-inline.fr/demo/constellation/template/js/libs/modernizr.custom.min.js"></script>
<script src="js/index.js"></script>
</head>

<body>
	<s:actionerror />
	<!-- Header -->

	<!-- Server status -->
	<header></header>
	<!-- End server status -->

	<!-- Main nav -->
	<%@include file='header.jsp'%>	


	<div id="header-shadow"></div>
	<!-- End header -->

	<!-- Always visible control bar -->
	<div id="control-bar" class="grey-bg clearfix">
		<div class="container_12"></div>
	</div>
	<!-- End control bar -->

	<!-- Content -->
	<article class="container_12">

		<section class="grid_8">
			<div class="block-border">
				<form name="editForm" class="block-content form" id="complex_form"
					method="get" action="update">
					<s:iterator value="programmeList" var="prog">
						<h1>Programme Form</h1>
						<div class="block-controls"></div>
						<ul class="message warning no-margin">
							<li id="message">This is a <strong>warning message</strong>,
								inside a box
							</li>
							<li class="close-bt"></li>
						</ul>
						<div class="columns">
							<div>
								<ul class="tabs js-tabs same-height">
									<li class="current"><a href="#tab-locales" title="Locales">Details</a>
									</li>
								</ul>
								<div class="float-right" style="margin: -2.5em 2em 0 0;">
								<a class="button" id="324324" value="Deactivate"
										onclick="changeSource(this)" title="flag" href="#"> <span
										class="smaller"> <img id="flagImage" height="16"
											width="16" src="images/Decisions/disapprove.png" /> <strong
											id="flagLabel" class="tmpAc">Deactivate</strong>
									</span>
									</a> <a class="button" title="Save" onclick="ValidateData()"> <span
										class="smaller"><img height="16" width="16"
											src="images/Decisions/good_decision.png"><strong>
												Save </strong> </span>
									</a>
									<!-- input type="submit" value="Save"/> -->
									<a class="button" title="Back"
										href="javascript:history.back();"> <span class="smaller"><img
											height="16" width="16" src="images/Decisions/back.png"><strong>
												Back </strong> </span>
									</a>
								</div>
								<!--END .float-right-->

								<div class="tabs-content">
									<div style="height: 179px;" id="tab-locales">
										<div>
											<div class="columns">
												<p class="colx2-left">
													<label for="complex-en-url">Programme Name<strong
														style="color: red">*</strong>
													</label>
													<s:textfield name="programmeName" cssStyle="width: 100%" />
												</p>
												<p class="colx2-right">
													<label for="complex-en-subtitle">Contact</label>
													<s:textfield name="contactName"
														id="complex-en-subtitle" readonly="true" size="40"
														type="text" />
													<a href=""
														onclick="return popitup('search.action?contact.firstName=&contact.surName=')">
														Lookup</a>
												</p>
											</div>

											<div class="columns">
												<p class="colx2-left">
													<span class="label">Description</span>
													<s:textarea name="description" />
												</p>
												<p class="colx2-right">

													<s:hidden id="active" name="isActive" value="1" />
													<s:hidden name="programmeID" />
												</p>
											</div>

										</div>

									</div>
									<!--END .tab-locales-->

								</div>
								<!--END .tabs-content-->

							</div>

						</div>
						<!--END .columns-->
					</s:iterator>
				</form>
				<!--END Tag Form-->

			</div>
		</section>




		<div class="clear"></div>

	</article>

	<!-- End content -->

	<footer> </footer>

	<!--

	Updated as v1.5:
	Libs are moved here to improve performance

	-->

	<!-- Plugins -->
	<script src="js/libs/jquery.dataTables.min.js"
		tppabs="http://www.display-inline.fr/demo/constellation/template/js/libs/jquery.dataTables.min.js"></script>
	<script src="js/libs/jquery.datepick/jquery.datepick.min.js"
		tppabs="http://www.display-inline.fr/demo/constellation/template/js/libs/jquery.datepick/jquery.datepick.min.js"></script>

	<!-- Charts library -->
	<!--Load the AJAX API-->
	<script src="js/www.google.com/jsapi"
		tppabs="http://www.google.com/jsapi"></script>
	<script type="text/javascript">
		function changeSource(id) {
			var label = "";
			var value = "";
			var elem = document.getElementById('active');
			if (elem.value == null || elem.value == "1") {
				//alert("New programme will be deactive!!!");
				document.getElementById("flagImage").src = "images/Decisions/approve.png";
				label = "<strong>Activate</strong>";
				//id.value = "Deactivate";
				value = '0';
			} else if (elem.value == "0") {

				document.getElementById("flagImage").src = "images/Decisions/disapprove.png";
				label = "<strong>Deactive</strong>";
				//id.value = "Activate";
				value = '1';
			}
			document.getElementById("active").value = value;
			document.getElementById("flagLabel").innerHTML = label;
		}
		function ValidateData() {
			try {
				var x = document.forms[0]["programmeName"].value;
				var k = true;
	
				var MyPara = "";
				if (x == null || x == "") {
					MyPara = MyPara
							+ "Programme name must be filled out<br><br/>  ";
					k = false;
				}
	
				if (k == false) {
					document.getElementById('message').innerHTML = MyPara;
					var myPara = document.getElementById('message');
					myPara.style.color = "red";
				} else {
					document.forms[0].submit();
				}
			} catch (ex) {
				alert(ex.message);
			}
		}
	</script>

</body>
</html>